package cn.com.fuhuitong.main.mine.mode

import cn.com.fuhuitong.http.BaseApiService
import cn.com.fuhuitong.http.BaseResponse
import cn.com.fuhuitong.main.access.entity.UserResponse
import cn.com.fuhuitong.main.home.entity.HomeGoodsResponse
import cn.com.fuhuitong.main.mine.entity.*
import io.reactivex.Observable
import retrofit2.http.*

interface MineApi : BaseApiService {

    @GET("/api/address/address_list")
    fun addressList(
        @Header("token") token: String
    ): Observable<AddressListResponse>


    @POST("/api/address/address_add")
    fun addressAdd(
        @Header("token") token: String,
        @Body address: AddressAddEntity
    ): Observable<BaseResponse>

    @POST("/api/address/address_edit")
    fun addressEdit(
        @Header("token") token: String,
        @Body address: AddressAddEntity
    ): Observable<BaseResponse>

    @GET("/api/user/share")
    fun share(
        @Header("token") token: String
    ): Observable<MineShareResponse>

    @GET("/api/user/distribution_center")
    fun distributionCenter(
        @Header("token") token: String
    ): Observable<MineShareCenterResponse>

    @POST("/api/cash/add_cash")
    fun addCash(
        @Header("token") token: String,
        @Body entity: WithdrawEntity
    ): Observable<BaseResponse>

    @POST("/api/cash/store_add_cash")
    fun addStoreCash(
        @Header("token") token: String,
        @Body entity: WithdrawEntity
    ): Observable<BaseResponse>

    @GET("/api/cash/cash_list")
    fun cashList(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<WithdrawListResponse>

    @GET("/api/cash/store_cash_list")
    fun cashStoreList(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<WithdrawListResponse>

    @GET("/api/cash/cash_price")
    fun cashPrice(
        @Header("token") token: String
    ): Observable<WithdrawConfigResponse>

    @GET("/api/cash/store_cash_price")
    fun cashStorePrice(
        @Header("token") token: String
    ): Observable<WithdrawConfigResponse>


    @GET("/api/goods/goods_collection")
    fun goodsCollection(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<CollectionListResponse>


    @GET("/api/goods/del_goods_collection")
    fun delGoodsCollection(
        @Header("token") token: String,
        @Query("goods_collection_id") goodsCollectionId: String
    ): Observable<BaseResponse>

    @GET("/api/order/order_sign")
    fun orderSign(
        @Header("token") token: String
    ): Observable<OrderSignResponse>

    @GET("/api/user/edit_user_nickname")
    fun editUserNickname(
        @Header("token") token: String,
        @Query("nickname") nickname: String
    ): Observable<BaseResponse>

    @GET("/api/user/get_user_info")
    fun getUserInfo(
        @Header("token") token: String
    ): Observable<UserResponse>

    @GET("/api/order/store_commission")
    fun orderStoreCommission(
        @Header("token") token: String
    ): Observable<MineIncomeCenterResponse>

    @GET("/api/order/store_order")
    fun orderStoreOrder(
        @Header("token") token: String,
        @Query("page") page: String,
        @Query("limit") limit: String
    ): Observable<MineIncomeListResponse>
}